package com.dhecp.core.layui;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.dhecp.common.config.Global;

import java.util.List;

/**
 * @author layui树形数据实体
 *
 */
public class TreeDataModel{

	private String parentId;  // 节点PID
	private String id;        // 节点ID
	private String title;     // 节点标题
	private String vtype;     // 节点类型
	private String href;      // 点击节点弹出新窗口对应的 url
	private String hrefadd;   // 点击节点弹出制单页面对应的 url
	private String orgid;     //组织机构编码（组织机构树中使用）
	private String cid;       //组织机构所属公司（组织机构树中使用）
	private String orgPath;   //组织机构子公司部门路径（组织机构树中使用）
	private String orgPathAll;//组织机构全部门路径（组织机构树中使用）
	private int levels;       //当前层级
	private int maxlevels;    //最大层级
	private String iconClass; //图标
	private String menuIcon; //菜单图标
	private boolean allowAdd = false;   //是否允许新增（子结点）
	private boolean allowEdit = false;  //是否允许编辑
	private boolean allowDelete = false;//是否允许删除
	private boolean spread = false;   // 节点是否初始展开
	private boolean checked = false;  // 节点是否初始为选中状态
	private boolean disabled = false; // 节点是否为禁用状态
	private JSONObject attributes;
	private String moduleTable; //模块标识
	private String moduleGroup; //模块分组
	private String folderManagersAll; //资料文件夹管理者
	private int fid;       		//资料库节点ID（自增）
	private List<TreeDataModel> children;

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getVtype() {
		return vtype;
	}

	public void setVtype(String vtype) {
		this.vtype = vtype;
	}
	
	public String getHref() {
		if (href != null) {
			return href.replace("(urlAdmin)", Global.getUrlAdmin()).replace("(GUID)", this.id);
		} else {
			return href;
		}
	}

	public void setHref(String href) {
		this.href = href;
	}

	public String getHrefadd() {
		return hrefadd;
	}

	public void setHrefadd(String hrefadd) {
		this.hrefadd = hrefadd;
	}

	public String getOrgid() {
		return orgid;
	}

	public void setOrgid(String orgid) {
		this.orgid = orgid;
	}

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getOrgPath() {
		return orgPath;
	}

	public void setOrgPath(String orgPath) {
		this.orgPath = orgPath;
	}

	public String getOrgPathAll() {
		return orgPathAll;
	}

	public void setOrgPathAll(String orgPathAll) {
		this.orgPathAll = orgPathAll;
	}

	public int getLevels() {
		return levels;
	}

	public void setLevels(int levels) {
		this.levels = levels;
	}

	public int getMaxlevels() {
		return maxlevels;
	}

	public void setMaxlevels(int maxlevels) {
		this.maxlevels = maxlevels;
	}

	public String getIconClass() {
		return iconClass;
	}

	public void setIconClass(String iconClass) {
		this.iconClass = iconClass;
	}

	public boolean isAllowAdd() {
		return allowAdd;
	}

	public void setAllowAdd(boolean allowAdd) {
		this.allowAdd = allowAdd;
	}

	public boolean isAllowEdit() {
		return allowEdit;
	}

	public void setAllowEdit(boolean allowEdit) {
		this.allowEdit = allowEdit;
	}

	public boolean isAllowDelete() {
		return allowDelete;
	}

	public void setAllowDelete(boolean allowDelete) {
		this.allowDelete = allowDelete;
	}

	public boolean isSpread() {
		return spread;
	}

	public void setSpread(boolean spread) {
		this.spread = spread;
	}

	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}

	public boolean isDisabled() {
		return disabled;
	}

	public void setDisabled(boolean disabled) {
		this.disabled = disabled;
	}

	public JSONObject getAttributes() {
		return attributes;
	}

	public void setAttributes(JSONObject attributes) {
		this.attributes = attributes;
	}

	public List<TreeDataModel> getChildren() {
		return children;
	}

	public void setChildren(List<TreeDataModel> children) {
		this.children = children;
	}

	public String toJSONString() {
		return JSON.toJSONString(this);
	}

	public String getMenuIcon() {
		return menuIcon;
	}

	public void setMenuIcon(String menuIcon) {
		this.menuIcon = menuIcon;
	}

	public String getModuleTable() {
		return moduleTable;
	}

	public void setModuleTable(String moduleTable) {
		this.moduleTable = moduleTable;
	}

	public String getModuleGroup() {
		return moduleGroup;
	}

	public void setModuleGroup(String moduleGroup) {
		this.moduleGroup = moduleGroup;
	}

	public String getFolderManagersAll() {
		return folderManagersAll;
	}

	public void setFolderManagersAll(String folderManagersAll) {
		this.folderManagersAll = folderManagersAll;
	}

	public int getFid() {
		return fid;
	}

	public void setFid(int fid) {
		this.fid = fid;
	}
}
